<h1>Welcome to Meadowlark Travel</h1>
<!--引入局部文件partials-->
{{> weather}}
<p>ajax的PUT和DELETE</p>
<input type="text" id="id" value="1">
<input type="button" id="put" value="PUT">
<input type="button" id="del" value="DEL">
<script>
    $('#put').click(function () {
        $.ajax({
            url: '/api/tour/' + $('#id').val(),
            type: 'PUT',
            success: function (res) {
                console.log(res)
            },
            error: function (res) {
            }
        })
    });

    $('#del').click(function () {
        $.ajax({
            url: '/api/tour/' + $('#id').val(),
            type: 'DELETE',
            success: function (res) {
                console.log(res)
            },
            error: function (res) {
            }
        })
    });
</script>